#!/bin/bash
# 自启动脚本 仅作参考

set +e

# /usr/sbin/xwayland-satellite :11 &

# obs
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=wlroots >/dev/null 2>&1

# dms shell
# dms run >/dev/null 2>&1 &

# caelestia shell
# qs -c caelestia >/dev/null 2>&1 &

# noctalia shell
# qs -c noctalia-shell >/dev/null 2>&1 &

# notify
swaync -c ~/.config/mango/swaync/config.json -s ~/.config/mango/swaync/style.css >/dev/null 2>&1 &

# night light
wlsunset -T 3001 -t 3000 >/dev/null 2>&1 &

# wallpaper
swaybg -i ~/.config/mango/wallpaper/snow.jpg >/dev/null 2>&1 &

# top bar
waybar -c ~/.config/mango/waybar/config.jsonc -s ~/.config/mango/waybar/style.css >/dev/null 2>&1 &

# dock
lavalauncher -c ~/.config/mango/lavalauncher/lavalauncher.conf >/dev/null 2>&1 &

# xwayland dpi scale
# echo "Xft.dpi: 140" | xrdb -merge #dpi缩放
xrdb merge ~/.Xresources >/dev/null 2>&1

# ime input
fcitx5 --replace -d >/dev/null 2>&1 &

# keep clipboard content
wl-clip-persist --clipboard regular --reconnect-tries 0 >/dev/null 2>&1 &

# clipboard content manager
wl-paste --type text --watch cliphist store >/dev/null 2>&1 &

# bluetooth 
blueman-applet >/dev/null 2>&1 &

# network
nm-applet >/dev/null 2>&1 &

# Permission authentication
/usr/lib/xfce-polkit/xfce-polkit >/dev/null 2>&1 &
# /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 >/dev/null 2>&1 &

# for private use not for you
[ -e /dev/sda4 ] && udisksctl mount -t ext4 -b /dev/sda4 >/dev/null 2>&1

# idle to lightdown and shutdown screen
~/.config/mango/scripts/idle.sh >/dev/null 2>&1 &

# inhibit by audio
sway-audio-idle-inhibit >/dev/null 2>&1 &

# change light value and volume value by swayosd-client in keybind
swayosd-server >/dev/null 2>&1 &
